﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CubicFWNet.Data.Models.Mapping
{
    public class FinanceCostMap : EntityTypeConfiguration<FinanceCost>
    {
        public FinanceCostMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            this.Property(t => t.CreatorName)
                .HasMaxLength(64);

            this.Property(t => t.OriginalPeople)
                .HasMaxLength(64);

            this.Property(t => t.TechnologyPeople)
               .HasMaxLength(64);

            this.Property(t => t.Memo)
                .HasMaxLength(256);

            // Table & Column Mappings
            this.ToTable("FinanceCost");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.OrderId).HasColumnName("OrderId");
            this.Property(t => t.OrderProductId).HasColumnName("OrderProductId");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.CreatorId).HasColumnName("CreatorId");
            this.Property(t => t.CreatorName).HasColumnName("CreatorName");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");
            this.Property(t => t.ApplyTime).HasColumnName("ApplyTime");
            this.Property(t => t.TestWork).HasColumnName("TestWork").HasPrecision(18, 8);
            this.Property(t => t.ManageWork).HasColumnName("ManageWork").HasPrecision(18, 8); 
            this.Property(t => t.TechnologyPeople).HasColumnName("TechnologyPeople");
            this.Property(t => t.OperateWork).HasColumnName("OperateWork").HasPrecision(18, 8);
            this.Property(t => t.ToolWork).HasColumnName("ToolWork").HasPrecision(18, 8); 
            this.Property(t => t.SalesWork).HasColumnName("SalesWork").HasPrecision(18, 8); 
            this.Property(t => t.OriginalPeople).HasColumnName("OriginalPeople");
            this.Property(t => t.PriceConfirm).HasColumnName("PriceConfirm");
            this.Property(t => t.Memo).HasColumnName("Memo");
        }
    }
}
